home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
PInterfaces
/
Scrap.p
< prev
next >
Wrap
Text File
|
1996-05-01
|
7KB
|
186 lines
{
File: Scrap.p
Contains: Scrap Manager Interfaces.
Version: Technology: System 7.5
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
}
{$IFC UNDEFINED UsingIncludes}
{$SETC UsingIncludes := 0}
{$ENDC}
{$IFC NOT UsingIncludes}
UNIT Scrap;
INTERFACE
{$ENDC}
{$IFC UNDEFINED __SCRAP__}
{$SETC __SCRAP__ := 1}
{$I+}
{$SETC ScrapIncludes := UsingIncludes}
{$SETC UsingIncludes := 1}
{$IFC UNDEFINED __TYPES__}
{$I Types.p}
{$ENDC}
{$IFC UNDEFINED __FILEMANAGER__}
{$I FileManager.p}
{$ENDC}
{$PUSH}
{$ALIGN MAC68K}
{$LibExport+}
{
_________________________________________________________________________________________________________
* STUCTURES
_________________________________________________________________________________________________________
}
TYPE
ScrapRef = ^LONGINT;
ScrapItemUserReference = UInt32;
ScrapItemType = OSType;
{$IFC FOR_SYSTEM8_PREEMPTIVE }
{
_________________________________________________________________________________________________________
* SCRAP ITEM TYPE ATTRIBUTES
_________________________________________________________________________________________________________
}
ScrapItemTypeAttributes = OptionBits;
CONST
kScrapItemTypeNoAttributes = $00; { No scrap item type attributes }
kScrapItemTypeSenderOnly = $01; { Scrap item type is available to sender only }
kScrapItemTypeSenderTranslated = $02; { Scrap item type is translated by sender }
kScrapItemTypeNotSaved = $04; { Scrap item type should not be saved }
kScrapItemTypeSystemTranslated = $0100; { Scrap item type is translated by Scrap Manager }
{
_________________________________________________________________________________________________________
* FSOBJECTREF SCRAP ITEM TYPE
_________________________________________________________________________________________________________
}
kScrapItemTypeFSObject = 'fsob'; { scrap item type for FSObjectRef data }
TYPE
FSObjectScrapItemTypePtr = ^FSObjectScrapItemType;
FSObjectScrapItemType = RECORD
objectInfo_o: FSObjectInformation; { FSObject information }
object_t: FSObjectRef; { FSObjectRef - Call FSObjectRefRegister() before using }
END;
{
_________________________________________________________________________________________________________
* FSOBJECTREF PROMISE SCRAP ITEM TYPE
_________________________________________________________________________________________________________
}
CONST
kScrapItemTypePromiseFSObject = 'pfob'; { Scrap item type for promised FSObjectRef data }
TYPE
PromiseFSObjectScrapItemTypePtr = ^PromiseFSObjectScrapItemType;
PromiseFSObjectScrapItemType = RECORD
objectInfo_o: FSObjectInformation; { FSObject information }
promisedScrapItemType: ScrapItemType; { Promised scrap item type containing an FSObjectRef }
END;
{
_________________________________________________________________________________________________________
* CREATING & DELETING SCRAPS
_________________________________________________________________________________________________________
}
FUNCTION NewScrapRef(VAR scrapReference: ScrapRef): OSStatus; C;
FUNCTION DisposeScrapRef(scrapReference: ScrapRef): OSStatus; C;
{
_________________________________________________________________________________________________________
* ADDING SCRAP ITEMS
_________________________________________________________________________________________________________
}
FUNCTION AddScrapItemType(scrapReference: ScrapRef; newOrExistingUserReference: ScrapItemUserReference; newItemType: ScrapItemType; data: UNIV Ptr; dataSize: ByteCount): OSStatus; C;
FUNCTION SetScrapItemTypeData(scrapReference: ScrapRef; existingUserReference: ScrapItemUserReference; existingItemType: ScrapItemType; data: UNIV Ptr; dataSize: ByteCount; dataOffset: UInt32): OSStatus; C;
FUNCTION SetScrapItemTypeAttributes(scrapReference: ScrapRef; existingUserReference: ScrapItemUserReference; existingItemType: ScrapItemType; attributes: ScrapItemTypeAttributes): OSStatus; C;
FUNCTION SetScrapItemTypePromiseHint(scrapReference: ScrapRef; existingUserReference: ScrapItemUserReference; existingItemType: ScrapItemType; userPromiseHint: UInt32): OSStatus; C;
{
_________________________________________________________________________________________________________
* GETTING SCRAP ITEM INFORMATION
NOTE: ALL INDEXES ARE 1 BASED (1 .. N)
_________________________________________________________________________________________________________
}
FUNCTION CountScrapItems(scrapReference: ScrapRef; VAR numberScrapItems: ItemCount): OSStatus; C;
FUNCTION GetScrapItem(scrapReference: ScrapRef; scrapItemIndex: UInt32; VAR userReference: ScrapItemUserReference): OSStatus; C;
FUNCTION CountScrapItemTypes(scrapReference: ScrapRef; userReference: ScrapItemUserReference; VAR numberItemTypes: ItemCount): OSStatus; C;
FUNCTION GetScrapItemType(scrapReference: ScrapRef; userReference: ScrapItemUserReference; itemTypeIndex: UInt32; VAR itemType: ScrapItemType): OSStatus; C;
FUNCTION GetScrapItemTypeDataSize(scrapReference: ScrapRef; userReference: ScrapItemUserReference; itemType: ScrapItemType; VAR itemTypeDataSize: ByteCount): OSStatus; C;
FUNCTION GetScrapItemTypeData(scrapReference: ScrapRef; userReference: ScrapItemUserReference; itemType: ScrapItemType; data: UNIV Ptr; VAR dataSize: ByteCount; VAR dataOffset: UInt32): OSStatus; C;
FUNCTION GetScrapItemTypeAttributes(scrapReference: ScrapRef; userReference: ScrapItemUserReference; itemType: ScrapItemType; VAR attributes: ScrapItemTypeAttributes): OSStatus; C;
{$ENDC}
{$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
{
_________________________________________________________________________________________________________
* CLASSIC SCRAP MANAGER API
_________________________________________________________________________________________________________
}
TYPE
ScrapStuffPtr = ^ScrapStuff;
ScrapStuff = RECORD
scrapSize: SInt32;
scrapHandle: Handle;
scrapCount: SInt16;
scrapState: SInt16;
scrapName: StringPtr;
END;
PScrapStuff = ^ScrapStuff;
FUNCTION InfoScrap: ScrapStuffPtr;
{$IFC NOT GENERATINGCFM}
INLINE $A9F9;
{$ENDC}
FUNCTION UnloadScrap: SInt32;
{$IFC NOT GENERATINGCFM}
INLINE $A9FA;
{$ENDC}
FUNCTION LoadScrap: SInt32;
{$IFC NOT GENERATINGCFM}
INLINE $A9FB;
{$ENDC}
FUNCTION GetScrap(hDest: Handle; theType: ResType; VAR offset: SInt32): SInt32;
{$IFC NOT GENERATINGCFM}
INLINE $A9FD;
{$ENDC}
FUNCTION ZeroScrap: SInt32;
{$IFC NOT GENERATINGCFM}
INLINE $A9FC;
{$ENDC}
FUNCTION PutScrap(length: SInt32; theType: ResType; source: UNIV Ptr): SInt32;
{$IFC NOT GENERATINGCFM}
INLINE $A9FE;
{$ENDC}
{$ENDC}
{$ALIGN RESET}
{$POP}
{$SETC UsingIncludes := ScrapIncludes}
{$ENDC} {__SCRAP__}
{$IFC NOT UsingIncludes}
END.
{$ENDC}